package com.wideplay.warp.remoting;

import java.lang.annotation.Annotation;
import java.util.Set;

/**
 * Created by IntelliJ IDEA.
 * User: dprasanna
 * Date: 1/10/2007
 * Time: 16:24:35
 * <p/>
 *
 * Builds a router (remote proxy).
 *
 * TODO find a way to validate the binding is complete
 *
 * @author dprasanna
 * @since 1.0
 */
class RouterBuilderImpl implements RemoteScopeBindingBuilder {
    private final Class<?> iface;
    private final Set<RouterDescriptor> routerBindings;

    public RouterBuilderImpl(Class<?> iface, Set<RouterDescriptor> routerBindings) {
        this.iface = iface;
        this.routerBindings = routerBindings;
    }

    public void in(Class<? extends Annotation> remoteScope) {

        //build
        routerBindings.add(new RouterDescriptor(iface, remoteScope));
    }
}
